package com.cx.tool;

import java.util.ArrayList;
import java.util.List;

public class hotelScore {
     public double updateHotelScoreTool(List<Integer> hotelScores){
        int len = hotelScores.size();
        int sum = 0;
        double avg = 0;
        for(int i = 0;i < len;i++){
            sum += hotelScores.get(i);
        }
        if(len != 0) {
             avg =(double)sum / len;
        }
        return avg;
    }

    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        list.add(5);
        list.add(6);
        list.add(10);
        list.add(20);
//        System.out.println(updateHotelScore(list));
    }
}
